word 批量修改表格格式

For i = 1 To ActiveDocument.Tables.Count

 ActiveDocument.Tables(i).Cell(1, 1).Select
 With Selection
 .SelectRow
 .Font.Bold = True
 .Shading.BackgroundPatternColor = -603923969
End With
 ActiveDocument.Tables(i).Range.Font.Size = 10
 Next

  宏内容:修改表格第一行字体为粗体,背景为浅灰色

For i = 1 To ActiveDocument.Tables.Count
 ActiveDocument.Tables(i).Style = "my"
Next

  宏内容:修改文档中所有的表格,使其表格样式为“my”的样式格式。

For i = 1 To ActiveDocument.Tables.Count
 ActiveDocument.Tables(i).Style = "my"
With With ActiveDocument.Tables(i).Range.ParagraphFormat
       .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .LineSpacingRule = wdLineSpace1pt5
        .Alignment = wdAlignParagraphCenter
        .WidowControl = False
        .KeepWithNext = False
        .KeepTogether = False
        .PageBreakBefore = False
        .NoLineNumber = False
        .Hyphenation = True
        .FirstLineIndent = CentimetersToPoints(0)
        .OutlineLevel = wdOutlineLevelBodyText
        .CharacterUnitLeftIndent = 0
        .CharacterUnitRightIndent = 0
        .CharacterUnitFirstLineIndent = 0
        .MirrorIndents = False
        .TextboxTightWrap = wdTightNone
        .CollapsedByDefault = False
        .AutoAdjustRightIndent = True
        .DisableLineHeightGrid = False
        .FarEastLineBreakControl = True
        .WordWrap = True
        .HangingPunctuation = True
        .HalfWidthPunctuationOnTopOfLine = False
        .AddSpaceBetweenFarEastAndAlpha = True
        .AddSpaceBetweenFarEastAndDigit = True
        .BaseLineAlignment = wdBaselineAlignAuto
        End With
 Next

宏内容:修改表格段落格式

转载于:https://www.cnblogs.com/dorothychai/p/4012457.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值